/* 主要样式文件 */
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.active-tool {
    border-left: 4px solid #667eea;
    background-color: #f8fafc;
    color: #2563eb !important;
    font-weight: 500 !important;
}

/* 工具切换动画 */
.tool-content {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.tool-content.hidden {
    opacity: 0;
    transform: translateY(10px);
    display: none;
}

.tool-content.active {
    opacity: 1;
    transform: translateY(0);
}

/* JSON语法高亮 */
.json-key {
    color: #0066cc;
}

.json-string {
    color: #009900;
}

.json-number {
    color: #ff6600;
}

.json-boolean {
    color: #cc0066;
}

.json-null {
    color: #999999;
}

/* 代码编辑器样式 */
.code-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .gradient-bg .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .tool-content {
        padding: 1rem;
    }
}

/* 错误状态 */
.error-border {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.success-border {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* 加载状态 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 新的菜单分类样式 */
.tool-category {
    margin-bottom: 1.5rem;
}

.tool-category h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.tool-category .sidebar-tool {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0;
    transition: all 0.2s ease;
}

.tool-category .sidebar-tool:hover {
    background-color: #f3f4f6;
    transform: translateX(2px);
}

.filter-btn {
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-btn:hover:not(.bg-blue-500) {
    background-color: #f3f4f6;
}

/* 分类图标样式 */
.tool-category h3 i {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    color: #6b7280;
}

/* 工具图标统一大小 */
.sidebar-tool i {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* 搜索框优化 */
#search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 过滤按钮容器 */
.filter-container {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.25rem;
}

/* 响应式菜单优化 */
@media (max-width: 768px) {
    .tool-category h3 {
        font-size: 0.9rem;
    }
    
    .sidebar-tool {
        padding: 0.625rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* 代码显示区域样式 */
.code-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: 0.5px;
    tab-size: 2;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #ffffff;
    color: #333333;
    border-radius: 8px;
    position: relative;
}

.code-display::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.code-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.code-display::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.code-display::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 行号样式 */
.line-number {
    display: inline-block;
    min-width: 3em;
    padding-right: 1em;
    color: #999999;
    text-align: right;
    user-select: none;
    border-right: 1px solid #eeeeee;
    margin-right: 1em;
    font-weight: normal;
}

.line-content {
    display: inline-block;
    width: calc(100% - 4em);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* JSON语法高亮（优化版本） */
.json-key {
    color: #e74c3c;
    font-weight: bold;
}

.json-string {
    color: #27ae60;
}

.json-number {
    color: #8e44ad;
}

.json-boolean {
    color: #d35400;
    font-weight: bold;
}

.json-null {
    color: #999999;
    font-style: italic;
}

/* 输出模式选择样式 */
input[type="radio"]:checked + label {
    color: #2563eb;
    font-weight: 600;
}

input[type="checkbox"]:checked + label {
    color: #2563eb;
    font-weight: 500;
}

/* 代码编辑器风格的容器 */
.code-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.code-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.code-container::after {
    content: 'XML Output';
    position: absolute;
    top: 8px;
    left: 16px;
    color: #666666;
    font-size: 12px;
    font-weight: 500;
    z-index: 1;
}

/* 选择模式标签样式 */
.mode-selector {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px;
    display: flex;
    gap: 4px;
}

.mode-selector label {
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.mode-selector input[type="radio"]:checked + label {
    background: #3b82f6;
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 暗色主题的文本颜色调整 */
.code-display .text-gray-500 {
    color: #999999 !important;
}

/* 错误显示样式 */
.error-display {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    padding: 16px;
    color: #c53030;
}

.error-display .error-icon {
    color: #e53e3e;
}

/* 代码复制按钮样式 */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.code-copy-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}